package modele;

import java.util.*;
import java.util.Calendar;
/**
 * @author p0403809
 *
 */
public abstract class Event {

    private Calendar date;
    private String description;
    private String commentaire;
    //private ArrayList <User> Utilisateurs;
    private int id;

    public Event(int _id, String desc){
        description=desc;
        id=_id + 1;
        date = new GregorianCalendar();
    }
   
    public Event(int _id, String desc, String com){
        description=desc;
        commentaire=com;
        id =_id + 1;
        date = new GregorianCalendar();
    }
   
    public Event(int _id,int year, int month, int day, int hour, int minute, String desc, String com){
        this.date = new GregorianCalendar();
        date.set(year,month,day,hour,minute);
        description=desc;
        commentaire=com;
        //Utilisateurs = new ArrayList<User>();
        id=_id + 1;
    }

    public Event(int _id,int year, int month, int day, String desc, String com){
        date = new GregorianCalendar();
        date.set(year,month,day);
        description=desc;
        commentaire=com;
        //Utilisateurs = new ArrayList<User>();
        id=_id + 1;
    }
   
    public String getDescription() {
        return description;
    }
   
    public Calendar getDate() {
    	return date;
    }
    /*
    public ArrayList<SimpleUser> getUtilisateurs() {
            return Utilisateurs;
    }
    public void addUser(User u){
            Utilisateurs.add(u);
    }
    public void removeUser(User u){
            for (int i= 0;i<Utilisateurs.size();i++)
            {
                    if ((Utilisateurs.get(i)).compareTo(u))
                            Utilisateurs.remove(i);
            }
    }
    */
   
   
    public String getCommentaire() {
        return commentaire;
    }
   
    public int getId() {
        return id;
    }
   
    public void setDate(int year,int month,int day) {
        ((Calendar) date).set(year, month,day);
    }

    public void setDate(int year,int month,int day,int heure,int minute) {
        date.set(year, month,day,heure,minute);
    }
    
    public void setDate(Date d) {
    	date.setTime(d);
    }
   
    public void setDescription(String description) {
        this.description = description;
    }
   
    public void setCommentaire(String commentaire) {
        this.commentaire = commentaire;
    }
   
    public boolean compareTo(Event e) {
            return (id==e.getId());
    }
}

